<template>
  <div class="flex flex-row aic mb-12px">
    <!-- 按钮循环 -->
    <template v-for="(item, index) in props.data" :key="index">
      <a-button @click="btnTap(item)" class="mr-10px" :type="item.btnType" v-if="item.type == 'btn'">{{
        item.text
      }}</a-button>
    </template>
  </div>
</template>
<script lang="ts" setup>
import { ref, EmitsOptions } from 'vue';
const props = defineProps({
  data: {
    type: Array,
    default: [],
  },
});
const emit = defineEmits<{
  (e: 'btnTap', item: object): void; //按钮事件
}>();
const btnTap = function (item: Object) {
  emit('btnTap', item);
};

console.log(props.data, 'data');
</script>
